Skip to content

[pull] master from ruby:master#110

Merged
pull[bot] merged 6 commits intosysfce2:masterfrom
ruby:master
Dec 24, 2025
Merged

[pull] master from ruby:master#110
pull[bot] merged 6 commits intosysfce2:masterfrom
ruby:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Dec 24, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

nobu and others added 6 commits December 24, 2025 14:13
https://github.com/ruby/ruby/actions/runs/20486207381/job/58869094401#step:14:641
>
/home/runner/work/ruby/ruby/src/gems/src/rdoc/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml:38:
warning: statement not reached


https://github.com/ruby/ruby/actions/runs/20486207381/job/58869094401#step:14:689
>
/home/runner/work/ruby/ruby/src/gems/src/rdoc/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml:16:
warning: statement not reached
I noticed that Markup elements are currently not standardized in any way
- even though the code does make some assumptions.

For example, there are visitors that depend on all elements implementing
`accept`, but no parent class or interface that will help guarantee
every element implements it. Some elements are implemented as structs,
while other are classes. Some have parent classes for shared
functionality and APIs and others don't.

I propose that we standardize the markup elements a bit more, so that we
can have a common interface for them. It will make it easier for the
RDoc to Markdown translator if we can enforce that every markup element
has to be able to print itself in Markdown - and I believe the code will
be easier to understand too.

This PR creates a base `Markup::Element` class and I standardized
`Heading` and `Table` as an example. I'm also finding it challenging to
understand the logic with no clue about what types are and what is
expected from each method, so I also propose we annotate some of these
as documentation - even if we're not adopting type checking.

If folks agree, I will continue to standardize more markup elements. I'm
trying to document what each element represents along the way.
Continuing the work from #1389. This PR standardizes the `HardBreak`
element to a consistent style and starts inheriting from `Element`.
Continuing the work from #1389. This PR standardizes the `BlankLine`
element to a consistent style and starts inheriting from `Element`.
Continuing the work from #1389. This PR standardizes the `Raw` element
to a consistent style and starts inheriting from `Element`.
Add a mention in both contributing and agents about the style of type
annotations we're using to help navigate the codebase and lower the
barrier to new contributors.
@pull pull bot locked and limited conversation to collaborators Dec 24, 2025
@pull pull bot added the ⤵️ pull label Dec 24, 2025
@pull pull bot merged commit 032024b into sysfce2:master Dec 24, 2025
4 of 5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants